package com.auxgroup.smarthome.job;

import com.dangdang.ddframe.job.lite.api.JobScheduler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: laiqiuhua.
 * @Date: 2017/9/12 15:23.
 */
@Configuration
public class DeviceShareRelieveScheduler extends CommonScheduler {

    @Bean(initMethod = "init")
    public JobScheduler relieveDeviceShareScheduler(final DeviceShareRelieveJob simpleJob,
                                                    @Value("${deviceShareRelieveScheduleJob.jobName}") final String jobName,
                                                @Value("${deviceShareRelieveScheduleJob.cron}") final String cron,
                                                @Value("${deviceShareRelieveScheduleJob.shardingTotalCount}") final int shardingTotalCount,
                                                @Value("${deviceShareRelieveScheduleJob.shardingItemParameters}") final String shardingItemParameters) {
        return createJobScheduler(simpleJob,jobName,cron,shardingTotalCount,shardingItemParameters);
    }

}
